package com.bite.writtenTraining;

import java.util.*;

/**
 * 除2
 * https://ac.nowcoder.com/acm/problem/213140
 */
public class Date11_26{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), k = in.nextInt();
        int[] arr = new int[n];
        long sum = 0;
        PriorityQueue<Integer> heap = new PriorityQueue<>((a,b)->{
            return b-a;
        });
        for(int i =0; i < n; i++){
            arr[i] = in.nextInt();
            sum += arr[i];
            if(arr[i] % 2 == 0){
                heap.add(arr[i]);
            }
        }

        while(!heap.isEmpty() && k != 0){
            long t = heap.poll() / 2;
            sum -= t;
            if(t % 2 == 0){
                heap.add((int)t);
            }
            k--;
        }
        System.out.println(sum);

    }
}